package Chapter2.Comparing.c8;

import java.io.*;

public class StandardIO2 {
    public static void main(String[] args) throws IOException {
        File file = new File("Doc/input.txt");
        if(!file.exists()) {
            /*try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }*/
            file.createNewFile();
        }
        FileWriter fr = new FileWriter(file);
        BufferedWriter bw = new BufferedWriter(fr);

        BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
        String str = bin.readLine();

        while(!(str.equals("!!!"))){
            bw.write(str);
            bw.newLine();
            str=bin.readLine();
        }
        bw.close();
        fr.close();
        bin.close();

        System.out.println(str);


    }
}
